var core = require('core');
var reg = require('./reg');
var count = function(data, callback){
    core.api('user/count', data, function(err, doc){
        try{
            if(doc.code)
                throw new Error(doc.msg);
            if(callback && typeof callback === 'function') callback(doc);
        }catch(e){
            console.error(e.message);
            if(callback && typeof callback === 'function') callback(e);
        }

    });

};

module.exports = count;
